﻿// 1.3.1.2.1. Next Date -> http://bgcoder.com/Contest/Practice/79

using System;
using System.Globalization;
using System.Threading;

class NextDate
{
    static void Main()
    {
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

        int day = int.Parse(Console.ReadLine());
        int month = int.Parse(Console.ReadLine());
        int year = int.Parse(Console.ReadLine());

        string format = "d.M.yyyy";
        DateTime userDate = new DateTime(year, month, day);
        userDate = userDate.AddDays(1);
        Console.WriteLine(userDate.ToString(format));
    }
}